package cn.vendai.com.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.Instant;

@Data
@Document(collection = "messages")
public class Message {
    @Id
    private String id;

    private String conversationId; // 会话ID
    private String userId;         // 用户ID
    private String role;           // "user" or "ai"
    private String content;        // 消息内容

    private Instant createdAt;     // 时间戳,TTL

}
